#include <iostream>
#include "vectorfunctions.h"

int cartprod(char a[], char b[], int m, int n, char c[][2])
{
	int i, j, row=0;
	for (i=0;i<m;i++){
		for(j=0;j<n;j++){
			c[row][0]=a[i];
			c[row][1]=b[j];
			++row;
		}
	}

return row;
}

int main()
{
	int m, n, l, col, j;
	char a[100], b[100], c[100][2];
	cout<<"Length of set A : ";
	cin>>m;
	readVector(a, m);
	cout<<"Length of set B : ";
	cin>>n;
	readVector(b, n);
	col = cartprod(a, b, m, n, c);
	for(j=0;j<col;j++)
		cout<<"("<<c[j][0]<<","<<c[j][1]<<") ";
	cout<<"\n";

return 0;
}
